using System;
using System.Collections.Generic;
using System.Text;

namespace Ant1.Decisions
{
    class GoToDecision : GameDecision  
    {
        public int X;
        public int Y;

        public GoToDecision(int x, int y)
        {
            this.X=x;
            Y=y;
        }

        public override bool OnTick(GameObject obj)
        {
            if (X < obj.X)
                obj.X--;
            else if(X> obj.X)
                obj.X++;

            if (Y < obj.Y)
                obj.Y--;
            else if (Y > obj.Y)
                obj.Y++;

            if (X == obj.X && Y == obj.Y)
                return true;
            else
                return false;
        }
    }
}
